<?php 
require_once '../includes/funciones.php';
conexion();
include ("seguridad.php");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title><?php titulopanel();?></title>
<link rel="STYLESHEET" type="text/css" href="estilo.css">
</head>


<body>

<div id="contenedor">

  	<div id="encabezado"><?php include('header.php') ?></div><!--fin de encabezado-->



	<div id="menuizquierda"><?php include('menu.php') ?></div>	<!--fin de menuizquierda-->

	
	<div id="content">
<?php
//conectamos a la base

			if(isset($_GET['pos']))//pregunta si la variable pos esta cargada
			{
			$inicio=sqlint($_GET['pos']);     //comienza desde el valor cargado en pos
			
			
			}
			else
			{
			
			 $inicio=0;						//else comienza con el ID_noticias en 0
			}

?>
	
	<div id="subcontent1">	
            
            <div id="botoncargar">
       <a href="cargar_publicidad.php"><input type="button" class="buttonadmin" value="Cargar"/></a>
       <a href="borrar_publicidad.php"><input type="button"  class="buttonadmin" value="Eliminar" style="width:70px;"/></a>
       </div>	
            
             
            <br/>
            <br/>
            <br/>
	</div>
	
	<div id="subcontent2">

		<?php
		if(isset($_SESSION["errorborrarnoticia"]))
		{
			if($_SESSION["errorborrarnoticia"] == "borrado")
			{
				echo "<br><p>Los Datos han sido Borrados Exitosamente</p><br>";
			}
		$_SESSION["errorborrarnoticia"]=" ";
		}
		?>
        
        
        
		<div id="headsubcontent2">Publicidades
		</div> <!-- end headsubcontent-->
		<br>
		<div id="tablepublicidad">
		<table width="400" cellspacing="0" cellpadding="0" align="center">
                 <tr>
    <td height="30">
        <?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='1'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="250px"  height="25px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="250px"  height="25px" src="../images_advertisement/generic.png"';
}
?>
    </td>
    <td width="150" height="25">
          <?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='3'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?>
    </td>
  </tr>
                    
                    
                    
                    
                    
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='4'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='5'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td height="30"> <?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='2'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="250px"  height="25px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="250px"  height="25px" src="../images_advertisement/generic.png"';
}
?></td>
      
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='6'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='7'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='8'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='9'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='10'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='11'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='12'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='13'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='14'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='15'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='16'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="150" height="25"><?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='17'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="120px"  height="20px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="120px"  height="20px" src="../images_advertisement/generic.png"';
}
?></td>
  </tr>
  <tr>
    <td> <?php
$conpub = mysql_query("SELECT * FROM `advertisement` where id='18'");
if(mysql_num_rows($conpub)!=0){
while($publicidad = mysql_fetch_array($conpub)){
echo '<img width="250px"  height="25px" src="../'.$publicidad[folder].$publicidad[url].'"';
}
}else{
echo '<img width="250px"  height="25px" src="../images_advertisement/generic.png"';
}
?></td>
    <td width="150" height="25"></td>
  </tr>
                </table>
                    
  
    
<br/>
</div>
		
			
		
	</div><!-- fin subcontent2 -->
		<br/><br/>	
		
	</div><!--fin de content-->


	<div id="piepagina"></div>	<!--fin de piepagina-->

</div>	<!--fin de contenedor-->


</body>
</html>
